package com.crm.manager.service.impl;

import com.crm.manager.domain.dto.BusinessPageDTO;
import com.crm.manager.domain.dto.TimeDto;
import com.crm.manager.domain.vo.BaseInfoVO;
import com.crm.manager.mapper.IndexMapper;
import com.crm.manager.service.IndexService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Slf4j
@Service
public class IndexServiceImpl implements IndexService {

    @Autowired
    private IndexMapper indexMapper;

    @Override
    public BaseInfoVO getBaseInfo(TimeDto dto) {
        return indexMapper.getBaseInfo();
    }

    @Override
    public List<Map> getBusinessChangeStatistics(TimeDto dto) {
        return indexMapper.getBusinessChangeStatistics(dto.getBeginCreateTime(), dto.getEndCreateTime());
    }

    @Override
    public List<Map> salesStatistic(TimeDto dto) {
        return indexMapper.salesStatistic(dto.getBeginCreateTime(), dto.getEndCreateTime());
    }
}
